package com.csun.cmny.provider.model.dto.channel;

import com.csun.cmny.provider.validator.OmcMonitorLogValidator;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.ibatis.type.Alias;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-02-13 16:42
 * @Description: the class device bind base entity
 */
@Data
public class channelSaveDto implements Serializable{




    /**
     * 咨询人
     */
    @NotEmpty(message = "{channel.consultName.null}")
    private String consultName;

    /*与老人关系 0-夫妻 1-子女 2-兄弟姐妹 3-旁系亲属 4-朋友 5-其他*/
    @NotNull(message = "{channel.relation.null}")
    private Integer relation;

    /*咨询日期*/
    @NotEmpty(message = "{channel.consultDate.null}")
    @Size(min = 1, max = 10, message = "{Monitorlog.date.length.error}",groups = {OmcMonitorLogValidator.class})
    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}")
    private String consultDate;

    /*联系方式*/
    @NotEmpty(message = "{channel.phone.null}")
    @Pattern(regexp = "^((\\+86)|(86))?(13|15|16|17|18|19)\\d{9}$",
            message = "{channel.phone.error}")
    private String phone;

    /*老人名字*/
    @NotEmpty(message = "{channel.oldName.null}")
    private String oldName;

    /*性别 0-男 1-女*/
    @NotNull(message = "{channel.gender.null}")
    private Integer gender;

    /*年龄*/
    @NotNull(message = "{channel.age.null}")
    private Integer age;

    /*咨询方式  0-来访 1-电话 2-微信 3-qq*/
    @NotNull(message = "{channel.way.null}")
    private Integer way;



    /*咨询意向 0-准备入住 1-预定床位 2-了解情况*/
    @NotNull(message = "{channel.intention.null}")
    private Integer intention;

    /*媒介渠道 0-家属介绍 1-电视 2-传单 3-互联网 4-报纸 5-广告*/
    @NotNull(message = "{channel.channel.null}")
    private Integer channel;



}
